﻿
-----------------------------------------------------------------------
-- MatrixText.lua
--
-- A Framework for World Of Warcraft addons
-- Copyright (C) 2007  wwkkii
-- 
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- any later version.
-- 
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
-- 
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
-- 
-- Home Page: http://code.google.com/p/wowmatrix
-----------------------------------------------------------------------

local __version__ = { "MatrixText", 0, 1, 1 };
if (MatrixUpdateVersion(__version__)) then return; end

local matrix_messages = {
	ERROR_GENERIC = "Generic Error",
	ERROR_INVAL = "Bad input arguments",
	ERROR_NOT_FOUND = "Not Found: %s %s",
	ERROR_BAD_NAME = "Bad name : %s",
	ERROR_BAD_OBJECT = "Bad Object",
	ERROR_BAD_ENUM = "Bad Enum",
	ERROR_BAD_CLASS = "Bad Class",
	ERROR_BAD_INTERFACE = "Bad Interface",
	ERROR_BAD_MEMBER = "Use bad member name: %s.",
	ERROR_BAD_OPTION = "Bad Option item: %s",
	ERROR_NAME_CONFLICT = "Name Conflict: %s",
	ERROR_MEMBER_CONFLICT = "Multiple same name member defined: %s",
	ERROR_NEW_VIRTUAL = "Create object with virtual class: %s",
	ERROR_EXTEND_FINAL = "Extend finalize class: %s",
	ERROR_MODIFY_CONST = "Modify constant variable: %s",
	ERROR_ALIAS_DENIED = "Call alias command before bind.",
};

matrix.TextInfo = function(mesg, ...)
	local fmt = matrix_messages[mesg];
	if (not fmt) then
		fmt = mesg;
	end
	return string.format(fmt, ...);
end


